﻿
<template>
    <el-select placeholder="请选择学期" size="mini" v-model="pzoption.value" class="form-control filter" style="height: 34px;padding:0px">
        <el-option v-for="item in xqdata"
                   :key="item.xq"
                   :label="item.xq"
                   :value="item.xq">
            <span style="float: left">{{ item.xq }}</span>
            <span v-show="item.isnow=='Y'" style="float: right; color: #8492a6; font-size: 13px">当前 </span>
        </el-option>
    </el-select>
</template>

<script>
    module.exports = {
        props: ['pzoption', 'isnow'],
        data() {
            return {
                xqdata: [],
            };
        },
        computed: {
            isxh: function () {

            }
        },
        methods: {
            change: function ($event) {

            }
        },
        watch: {

        },
        mounted: function () {
            var chi = this;
            chi.$nextTick(function () {
                chi.xqdata = JSON.parse(localStorage.getItem("xqdata"));
                if (chi.isnow == "") {
                    chi.pzoption.value = _.find(chi.xqdata, function (obj) {
                        return obj.isnow == 'Y';
                    }).xq;
                } else {
                    chi.pzoption.value = chi.xqdata[0].xq;
                }


            })

        }
    };
</script>